<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initNavigation(){
        
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view = $layout->getView();
        
        $menus = new Zend_Config_Xml(APPLICATION_PATH."/configs/navigation.xml","admin");
       
        $navigation = new Zend_Navigation($menus);
        $view->navigation($navigation);        
    }
    

    protected function _initRewrite() {
        $front = Zend_Controller_Front::getInstance();
        $router = $front->getRouter();
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production');
        $router->addConfig($config,'routes');
    } 
    
    public function _initCart()
    {
        
        $cart = new Zend_Session_Namespace("cart");
        if(!isset($cart->total)){
            $cart->total = 0;
            $cart->items = array();    
        }
    }
    
}

